1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */
28 module derelict.anttweakbar.types;
29 
30 import core.stdc.config;
31 
32 alias CTwBar TwBar;
33 alias ETwType TwType;
34 alias void function(const(void)*, void*) TwSetVarCallback;
35 alias void function(void*, void*) TwGetVarCallback;
36 alias void function(void*) TwButtonCallback;
37 alias CTwEnumVal TwEnumVal;
38 alias CTwStructMember TwStructMember;
39 alias void function(char*, c_ulong, const(void)*, void*) TwSummaryCallback;
40 alias void function(char**, const(char)*) TwCopyCDStringToClient;
41 alias ETwParamValueType TwParamValueType;
42 alias ETwGraphAPI TwGraphAPI;
43 alias ETwKeyModifier TwKeyModifier;
44 alias EKeySpecial TwKeySpecial;
45 alias ETwMouseAction TwMouseAction;
46 alias ETwMouseButtonID TwMouseButtonID;
47 alias void function(const(char)*) TwErrorHandler;
48 alias void function(int, int, int, int) GLUTmousebuttonfun;
49 alias void function(int, int) GLUTmousemotionfun;
50 alias void function(ubyte, int, int) GLUTkeyboardfun;
51 alias void function(int, int, int) GLUTspecialfun;
52 
53 alias ETwType = int;
54 enum : ETwType {
55     TW_TYPE_UNDEF    = 0,
56     TW_TYPE_BOOL8    = 2,
57     TW_TYPE_BOOL16   = 3,
58     TW_TYPE_BOOL32   = 4,
59     TW_TYPE_CHAR     = 5,
60     TW_TYPE_INT8     = 6,
61     TW_TYPE_UINT8    = 7,
62     TW_TYPE_INT16    = 8,
63     TW_TYPE_UINT16   = 9,
64     TW_TYPE_INT32    = 10,
65     TW_TYPE_UINT32   = 11,
66     TW_TYPE_FLOAT    = 12,
67     TW_TYPE_DOUBLE   = 13,
68     TW_TYPE_COLOR32  = 14,
69     TW_TYPE_COLOR3F  = 15,
70     TW_TYPE_COLOR4F  = 16,
71     TW_TYPE_CDSTRING = 17,
72     TW_TYPE_QUAT4F   = 19,
73     TW_TYPE_QUAT4D   = 20,
74     TW_TYPE_DIR3F    = 21,
75     TW_TYPE_DIR3D    = 22
76 }
77 
78 alias ETwParamValueType = int;
79 enum : ETwParamValueType {
80     TW_PARAM_INT32   = 0,
81     TW_PARAM_FLOAT   = 1,
82     TW_PARAM_DOUBLE  = 2,
83     TW_PARAM_CSTRING = 3
84 }
85 
86 
87 alias ETwGraphAPI = int;
88 enum : ETwGraphAPI
89 {
90     TW_OPENGL      = 1,
91     TW_DIRECT3D9   = 2,
92     TW_DIRECT3D10  = 3,
93     TW_DIRECT3D11  = 4,
94     TW_OPENGL_CORE = 5  // NOTE: Use this one when using a CORE OpenGL profile, TW_OPENGL will not work!
95 }
96 
97 alias ETwKeyModifier = int;
98 enum : ETwKeyModifier {
99     TW_KMOD_NONE  = 0,
100     TW_KMOD_SHIFT = 3,
101     TW_KMOD_CTRL  = 192,
102     TW_KMOD_ALT   = 256,
103     TW_KMOD_META  = 3072
104 }
105 
106 alias EKeySpecial = int;
107 enum : EKeySpecial {
108     TW_KEY_BACKSPACE = 8,
109     TW_KEY_TAB       = 9,
110     TW_KEY_CLEAR     = 12,
111     TW_KEY_RETURN    = 13,
112     TW_KEY_PAUSE     = 19,
113     TW_KEY_ESCAPE    = 27,
114     TW_KEY_SPACE     = 32,
115     TW_KEY_DELETE    = 127,
116     TW_KEY_UP        = 273,
117     TW_KEY_DOWN      = 274,
118     TW_KEY_RIGHT     = 275,
119     TW_KEY_LEFT      = 276,
120     TW_KEY_INSERT    = 277,
121     TW_KEY_HOME      = 278,
122     TW_KEY_END       = 279,
123     TW_KEY_PAGE_UP   = 280,
124     TW_KEY_PAGE_DOWN = 281,
125     TW_KEY_F1        = 282,
126     TW_KEY_F2        = 283,
127     TW_KEY_F3        = 284,
128     TW_KEY_F4        = 285,
129     TW_KEY_F5        = 286,
130     TW_KEY_F6        = 287,
131     TW_KEY_F7        = 288,
132     TW_KEY_F8        = 289,
133     TW_KEY_F9        = 290,
134     TW_KEY_F10       = 291,
135     TW_KEY_F11       = 292,
136     TW_KEY_F12       = 293,
137     TW_KEY_F13       = 294,
138     TW_KEY_F14       = 295,
139     TW_KEY_F15       = 296,
140     TW_KEY_LAST      = 297
141 }
142 
143 alias ETwMouseAction = int;
144 enum : ETwMouseAction {
145     TW_MOUSE_RELEASED = 0,
146     TW_MOUSE_PRESSED  = 1
147 }
148 
149 alias ETwMouseButtonID = int;
150 enum : ETwMouseButtonID {
151     TW_MOUSE_LEFT   = 1,
152     TW_MOUSE_MIDDLE = 2,
153     TW_MOUSE_RIGHT  = 3
154 }
155 
156 
157 struct CTwEnumVal {
158     int Value;
159     const(char)*Label;
160 }
161 
162 
163 struct CTwStructMember {
164     const(char)*Name;
165     TwType Type;
166     size_t Offset;
167     const(char)*DefString;
168 }
169 
170 
171 struct CTwBar;